$(() => {
    // 获取用户信息
    fetchData('http://47.94.207.7/api/m/login/info').then(async res => {
        let data = await res
        $('#username').html(data.data.username)
    })

    // 获取订单

    fetchData('http://47.94.207.7/api/m/order/order').then(async res => {
        let data = await res
        let list = data.data
        list.forEach(item => {
            $('.my-wrap').append(`
                <div class="wrap-item">
                    <div class="item-pic">
                        <img src="img/my/item-pic.png" alt="">
                    </div>
                    <div class="item-info">
                        <div class="item-name">${item.name}</div>
                        <div class="item-content">${item.content}</div>
                    </div>
                    <div class="item-total">已完成数量：1</div>
                        <div class="item-link">
                            <div class="item-btn">复制推荐码</div>
                        </div>
                    </div>
                </div>
            `)
        })
    })

})